package com.it.emall.controller;

import com.it.emall.domain.Recipes;
import com.it.emall.service.RecommendationsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class RecommendationController {


    @Autowired
    private RecommendationsService recommendationsService;


    @GetMapping("/recommendations")
    public List<Recipes> getRecommendations(@RequestParam(required = false, defaultValue = "0") int userId) {
        return recommendationsService.getRecommendations(userId);
    }
}
